package com.shu.test.jaxb;

import java.util.Date;

public class JaxbThread extends Thread{

	@Override
	public void run() {
		for(int i=0; i<1000000; i++) {
			Book book = new Book();
			book.setId(100);
			book.setAuthor("James");
			book.setCalendar(new Date());
			book.setPrice(23.45f); // 默认是0.0
			Student s = new Student();
			s.setId(23);
			s.setName("张三");
			s.setLever("小学");
			s.setAge(34);
			
			String str = JaxbUtils.convertToXml(book);
			//System.out.println(str);
			String str2 = JaxbUtils.convertToXml(s);
			
			Book book2 = JaxbUtils.converyToJavaBean(str, Book.class);
			//System.out.println(book2);
			Student s2 = JaxbUtils.converyToJavaBean(str2, Student.class);
			//System.out.println(str2);
			
			//System.out.println(s2);
			System.out.println("----------------------"+i);
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	
}
